-- vim:set ft=lua: PAGE_COUNT=50 dofile(mg.script_name:gsub('[^\\/]*$','')..'util.lua') vtag=GetVarInt(mg.request_info.query_string,'vtag') or -1 ct=CreateContentBuilder(GZIP_THRESHOLD_BYTE) ct:Append([=[

# 予約一覧

]=]) rsdef=(edcb.GetReserveData(0x7FFFFFFF) or {}).recSetting rate={} for i=page*PAGE_COUNT+1,math.min(#a,(page+1)*PAGE_COUNT) do v=a[i] size=nil if (v.recSetting.recMode~=5 and v.recSetting.recMode or v.recSetting.noRecMode or 1)~=4 then --予想ファイルサイズ for j=1,4 do key=('%04X%04X%04X'):format((j>3 and 65535 or v.onid),(j>2 and 65535 or v.tsid),(j>1 and 65535 or v.sid)) rate[key]=rate[key] or tonumber(edcb.GetPrivateProfile('BITRATE',key,0,'Bitrate.ini')) or 0 if rate[key]>0 then break elseif j==4 then rate[key]=19456 end end size=rate[key]/8*1000*math.max((v.recSetting.startMargin or rsdef and rsdef.startMargin or 0)+ (v.recSetting.endMargin or rsdef and rsdef.endMargin or 0)+v.durationSecond,0) end cl=v.recSetting.recMode==5 and ' class="disabled"' or v.overlapMode==1 and ' class="partially"' or v.overlapMode==2 and ' class="shortage"' or '' ct:Append('
' ..FormatTimeAndDuration(v.startTime, v.durationSecond) ..''..v.stationName..''..v.title ..''..(RecModeTextList()[(v.recSetting.recMode~=5 and v.recSetting.recMode or v.recSetting.noRecMode or 1)+1] or '') ..''..v.recSetting.priority ..''..(size and ('%.1fG'):format(size/1024/1024/1024) or '')..'
\n') end ct:Append([=[

]=]) a={} for i,v in ipairs(edcb.FindFile('\\\\.\\pipe\\SendTSTCP_*',0) or {}) do n=v.name:match('^[^_]+_(%d+)_%d+$') if n then a[#a+1]=n end end if #a>0 then n=mg.get_var(mg.request_info.query_string,'fname') or a[1] audio2=GetVarInt(mg.request_info.query_string,'audio2')==1 dual=GetVarInt(mg.request_info.query_string,'dual',0,2) cinema=GetVarInt(mg.request_info.query_string,'cinema')==1 ct:Append('視聴 →'..(vtag==0 and 'Video' or 'DL')..'\n' ..'
\n' ..'\n' ..'
\n' ..'audio2\n' ..'
\n' ..'cinema\n' ..(vtag==0 and '\n' or '\n') ..'
\n') if vtag==1 then for i,v in ipairs(a) do if n==v then ct:Append('view.lua\n') break end end end end ct:Append([=[
]=]) ct:Finish() mg.write(ct:Pop(Response(200,'text/html','utf-8',ct.len)..(ct.gzip and 'Content-Encoding: gzip\r\n' or '')..'\r\n'))